#pragma once

#if USE_STD_SDL
#include <vector>
#else
#include <EASTL/vector.h>
#include <EASTL/list.h>
#endif

#include <utl/allocator.h>

namespace utl
{
#if USE_STD_SDL
template <typename T>
	using vector = std::vector<T>;
#else
	template <typename T>
	using vector = eastl::vector<T, allocator>;

	template <typename T>
	using list = eastl::list<T, allocator>;

	template <typename T, typename K>
	using pair = eastl::pair<T, K>;

	using eastl::make_pair;
#endif



	template <typename T>
	void vector_delete(vector<T> &vec, typename vector<T>::iterator iter)
	{
		if (vec.size() > 1)
		{
			(*iter) = (*(vec.end() - 1));
			vec.pop_back();
		}
		else
		{
			vec.clear();
		}
	}

	template <typename T>
	void vector_delete_element(vector<T> &vec,T element)
	{
		for(auto itor = vec.begin() ;itor != vec.end() ; itor ++ )
		{
			if (*itor == element)
			{
				vector_delete(vec,itor);
				break;
			}
		}
	}
}